package com.fzz.learning_forum.service;

import com.fzz.learning_forum.domain.Article;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface ArticleService {

    //分页查询文章
    public PageInfo<Article> selectArticleWithPage(Integer page, Integer count);

    //根据id查询自己的文章
    public PageInfo<Article> selectArticleWithPageById(Integer page,Integer count,Integer id);

    //根据tags模糊查询文章
    public PageInfo<Article> selectArticleByTags(Integer page,Integer count,String tags);

    //发布动态
    public Integer publishArticle(Article article);

    //根据id查询动态细节
    public Article selectArticleDetail(Integer id);

    //修改动态内容
    public Integer editArticle(Article article);

    //根据id删除动态
    public Integer deleteArticle(Integer id);

    //根据id更新动态的热度
    public Integer updateArticleHit(Integer id,Integer hit);

    //根据热度值排序
    public List<Article> selectArticleByHit();

    //根据id更新动态的浏览量
    public Integer updateArticleView(Integer id,Integer view);

    //根据浏览量排序
    public List<Article> selectArticleByView();

    //根据热度值和浏览量查出热门推荐
    public List<Article> selectArticleByHitAndView();
}
